﻿var parentClose = false;   
var paramsAllready = false;

function getQueryString(queryName) {
    var queryValue = "";
    var queryFound = false;
    if (window.location.search != "") {
        var search = window.location.search;
        var i = 0;
        while (i <= search.length) {
            start = i;
            end = start + queryName.length;
            if (search.substring(start, end) == queryName) {
                queryFound = true;
                break;
            }
            i++;
        }
        if (queryFound) {
            start = end + 1;
            end = search.indexOf("&", start);
            if (end < start)
                end = search.length;
            var getvalue = search.substring(start, end);
            return unescape(getvalue);
        }
    }
    return queryValue;
}

window.onunload = function() {
    if (parentClose != true && window.opener !=null) {
        window.opener.remaskBody(window.opener.maskDivId);
        window.opener.newWindowManager.Remove(name, false, false);
    }
}

// 验证是否为邮箱地址
function verifyAddress(email) {
    var pattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
    flag = pattern.test(email);
    if (flag) {
        return true;
    }
    else {
        return false;
    }
}

function closeWithNoTip() {
    window.opener = null;
    window.open("", "_self");
    window.close();
}
